<?php 
class LsPagerWidget
extends CWidget
{
	
	public
		$params = null,
		$pagination = null,
		$route = '',
		$template = 'paging.tpl',
		$radius = 4
	;
	
	public function run(){
		if(!($this->pagination instanceof CPagination)){
			return;
		}
		parent::run();
		if(!is_array($this->params)){
			$this->params = $_GET;
		}
		$currentPage = $this->pagination->getCurrentPage();
		unset($this->params[$this->pagination->pageVar]);
		$aPaging = Yii::E()->Viewer_MakePaging(
			$this->pagination->getItemCount(),
			$currentPage+1,
			$this->pagination->getPageSize(),
			$this->radius,
			$this->getController()->createUrl($this->route, $this->params)
		);
		$this->getController()->smartyRender($this->template, compact('aPaging'), false, false);
	}
	
}

?>